package com.itheima.treeset;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class setDemo {
    public static void main(String[] args) {
        Set<String> set=new TreeSet<>();
        set.add("aaa");
        set.add("aaa");
        set.add("ccc");
        set.add("bbb");
        /*for (String s : set) {
            System.out.println(s);
        }*/
        set.removeIf((s)->s.length()==3);
        Iterator<String> iterator=set.iterator();
        //set.removeIf((s)->s.length()==3);//??????????????????????????????????????????????????????
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }

    }
}
